// store.js
import Vue from 'vue'
import Vuex from 'vuex'

import createPersistedState from 'vuex-persistedstate'
Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    isDark: false
  },
  mutations: {
    SET_ISDARK: (state) => {
      state.isDark = !state.isDark
    }
  },
  actions: {
    setIsDark({ commit }) {
      commit('SET_ISDARK')
    }
  },
  modules: {},
  plugins: [createPersistedState()]
})

export default store


